$().ready(function() {
	$('.back-btn a').click(function(){
		btwo = $('.back-btn-two').length;
		if(btwo>0){
			$('.back-btn-two').remove();
		}
		$('.box-wrapper-icons').fadeOut("fast");
		$('.box-wrapper-two').animate({
			"margin-left":"20px"
		},1000,function(){
			
		});	
		$('.box-wrapper-one').animate({
			"margin-left":"10px"
		},1000,function(){
			$('.box-two .title span').text("");
		});
	});
});
function switchwindow(func_call){
	btwo = $('.back-btn-two').length;
	if(btwo>0){
		$('.back-btn-two').remove();
	}	
	btu = $('.top-user-btn').length;
	if(btu>0){
		if(func_call!='topuser'){
			$('.top-user-btn').remove();
		}
	}
	switch(func_call){
		case 'settings': 
			settings();
			do_change();
		break;
		case 'countdown': 
			do_change();
		break;
		case 'checkuplog': 
			do_change();
		break;		
		case 'trimesterguide': 
			do_change();
		break;
		case 'tipoftheday': 
			do_change();
		break;
		case 'checklist': 
			do_change();
		break;
		case 'diary': 
			do_change();
		break;
		case 'topuser': 
			do_change();
		break;		
		case 'obgynedirectory': 
			do_change();
		break;		
		default:
			return false;
		break;
	}

}
function do_change(){
	$('.box-wrapper-two').animate({
		"margin-left":"10px"
	},1000,function(){

	});	
	$('.box-wrapper-one').animate({
		"margin-left":"-500px"
	},1000,function(){
		$('.box-wrapper-icons').fadeIn("slow");
	});
}
function switchwindow_no_animate(func_call){
	btwo = $('.back-btn-two').length;
	if(btwo>0){
		$('.back-btn-two').remove();
	}	
	btu = $('.top-user-btn').length;
	if(btu>0){
		if(func_call!='topuser'){
			$('.top-user-btn').remove();
		}
	}	
	switch(func_call){
	case 'settings': 
		settings();
		do_change_na();
	break;
	case 'countdown': 
		do_change_na();
	break;
	case 'trimesterguide': 
		do_change_na();
	break;
	case 'tipoftheday': 
		do_change_na();
	break;	
	case 'checklist': 
		do_change_na();
	break;	
	default:
		return false;
	break;	
	}

}
function do_change_na(){
	$('.box-wrapper-two').css({
		"margin-left":"10px"
	},1000,function(){
	
	});	
	$('.box-wrapper-one').css({
		"margin-left":"-500px"
	},1000,function(){
		$('.box-wrapper-icons').show("slow");
	});
}